<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>운세의 신</title>

	<link rel="stylesheet" type="text/css" href="http://www.unsin.co.kr/css/common.css" />
	<link rel="stylesheet" type="text/css" href="http://www.unsin.co.kr/css/result.css"/>
	
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script src="http://www.unsin.co.kr/js/result_html.js" type="text/javascript"></script>
	
	<script type="text/javascript" src="https://www.google.com/jsapi"></script>	
	<script type="text/javascript">
		google.load("visualization", "1", {packages:["corechart"]});
		google.setOnLoadCallback(drawChart);
		function drawChart() {
			var data = google.visualization.arrayToDataTable([
				  	  ['Year', '직업평균', '금전궁합', '내금전운', '상대금전운']
					, ['0'
						, (<?=$contents['graph']['avg_salary'][0] ?>+<?=$contents['your_graph']['avg_salary'][0] ?>)
						, (<?=$contents['graph']['my_salary'][0] ?>+<?=$contents['your_graph']['my_salary'][0] ?>)
						, <?=$annual_salary ?>
						, <?=$your_annual_salary ?>]
<?
	$max_len = count($contents['graph']['my_salary']) < count($contents['your_graph']['my_salary']) ? count($contents['graph']['my_salary']) : count($contents['your_graph']['my_salary']);
	$avg_total = 0;
	$our_total = 0;
?>
<?	for ($i=1; $i < $max_len; $i++) : ?>
					, ['<?=$i?>'
						, (<?=$contents['graph']['avg_salary'][$i] ?>+<?=$contents['your_graph']['avg_salary'][$i] ?>)
						, (<?=$contents['graph']['my_salary'][$i] ?>+<?=$contents['your_graph']['my_salary'][$i] ?>)
						, <?=$contents['graph']['my_salary'][$i] ?>
						, <?=$contents['your_graph']['my_salary'][$i] ?>
					]
<?
		$avg_total += $contents['graph']['avg_salary'][$i] + $contents['your_graph']['avg_salary'][$i];
		$our_total += $contents['graph']['my_salary'][$i] + $contents['your_graph']['my_salary'][$i];
?>
<?	endfor ?>
			]);

			var options = {
				title: '나와 애인의 금전궁합',
				chartArea:{left:100,top:50, width:500, height:150},
				curveType: 'function',
				hAxis: {
					title: '연차',  
					titleTextStyle: {
						color: '#FF0000'
					},
					slantedText:false
				},
				vAxis: {
					title: '연봉',
					titleTextStyle: {
						color: '#FF0000'
					},
					format:'#,###만원'
				},
				legend : {
					position: 'bottom'
				}
			};

			var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
			chart.draw(data, options);
		}
	</script>  

</head>
<body>
<input type="hidden" id="my_sex" value="<?=$member['sex']?>" />
<input type="hidden" id="your_sex" value="<?=$member['your_sex']?>" />
<div id="wrap">
	<div class="money2_box" id="result_html">
				<!--키비쥬얼-->
				<p><img src="http://www.unsin.co.kr/images/sub/money/result_money2_k.png" border="0" usemap="#Map" />
					<map name="Map" id="Map">
						<area shape="rect" coords="176,188,340,219" href="#" onClick="window.open ('/static/unse/money_info_pop.php', 'cong_window' , 'toolbar=0, location=0, status=0, menubar=0, scrollbars=1, resizable=1, top=50, left=400, width=730, height=480')" onfocus='this.blur()'>
					</map>
				</p>
				<!--//키비쥬얼-->

				<!-- 소개/사주명식/오행분석-->
				<?php echo $INC_SAJUMS; ?>
				<!--//자기소개/사주명식/오행분석-->
				<!--그래프-->
                <div class="money2_cont1">
                        <dl>
                        <dt><img src="http://www.unsin.co.kr/images/sub/money/table1_top01.png" alt="금전운 그래프" /></dt>
                        <dd class="chart"><div id="chart_div" style="width:630px; height:280px; "></div></dd>
                        <dd class="chart_info">
                                <p><img src="http://www.unsin.co.kr/images/sub/money/table1_bul.png" alt="정보설명타이틀" /></p>
                                <ul class="infomation">
                                <li>'나와 애인의 금전궁합'은 <strong>15년차</strong>까지의 정보만 보여집니다.</li>
                                <li>직업평균 : 본인 직업군의 평균 연봉을 말합니다.</li>
                                <li> 금전궁합 : 두 사람이 함께 했을 때, 예상되는 수입을 말합니다.</li>
                                <li class="top">해당 직업군의 평균 연봉은 기업 연봉정보 사이트 페이오픈 자료(2011년)를 근거로 합니다.</li>
                                <li class="top">'나와 애인의 금전궁합'은 <strong>두 사람의 연봉과 금전운을 바탕으로 한 서비스</strong>로써,<br />
                                       상대방과 결혼했을때 예상되는 금전 상황과 미래의 계획을 준비하는데 있어 매우 유용한 정보가 될 것입니다.</li>
                            </ul>
                            </dd>
                    </dl>
                        <!--금전운 토탈금액-->
                        <div class="chart_total">
                        <ul>
                                <li class="total_01"><img src="http://www.unsin.co.kr/images/sub/money/table_total_03.png" />
                                <p class="tonum"><?=number_format($avg_total)?>만원</p>
                            </li>
                                <li class="total_02"><img src="http://www.unsin.co.kr/images/sub/money/table_total_04.png" />
                                <p class="tonum"><?=number_format($our_total)?>만원</p>
                            </li>
                            </ul>
                    </div>
                        <!--//금전운 토탈금액-->
                        <p><img src="http://www.unsin.co.kr/images/sub/money/table1_bottom.png" /></p>
                    </div>
                <!--//그래프--> 
                
				<!--결과내용-->
				<div class="money2_cont1">	
                <dl>
                	<dt><img src="http://www.unsin.co.kr/images/sub/money/table1_top02.png" alt="금전궁합 총운" /></dt>
					<dd class="text">
						<?
                            $score = ($contents['graph']['score']+$contents['your_graph']['score']);
                            $key = 0;
                            if ($score <= -15) {
                                $key = -15;
                            } elseif ($score <= -12) {
                                $key = -12;
                            } elseif ($score <= -9) {
                                $key = -9;
                            } elseif ($score <= -6) {
                                $key = -6;
                            } elseif ($score <= -3) {
                                $key = -3;
                            } elseif ($score < 3) {
                                $key = 0;
                            } elseif ($score < 6) {
                                $key = 3;
                            } elseif ($score < 9) {
                                $key = 6;
                            } elseif ($score < 12) {
                                $key = 9;
                            } elseif ($score < 15) {
                                $key = 12;
                            } elseif ($score < 18) {
                                $key = 15;
                            } else {
                                $key = 18;
                            }
                            
                            foreach ($contents['X002'] as $item) {
                                if ($item['db_numerical'] == $key) {
                                    echo $item['db_data'];
                                }
                            }
                        ?>
					</dd>

                </dl>
                	<p><img src="http://www.unsin.co.kr/images/sub/money/table1_bottom.png" /></p>
                <!--//결과내용-->
                </div>

				<!--결과내용-->
				<div class="money2_cont1">	
                <dl>
                <dt><img src="http://www.unsin.co.kr/images/sub/money/table1_top03.png" alt="금전운 총운" /></dt>
                <dd class="text">
                <?	for ($i=1; $i < $max_len; $i++) : ?>
						<p class="date"><?=$i+date('Y',time())?>년 (<?=$i; ?>년차)</p>
						<p>본인 : <?=$contents['S042gu'][$i]['data']; ?></p>
						<p>상대방 : <?=$contents['S042gu_you'][$i]['data']; ?></p>
				<?	endfor ?>
                </dd>
                </dl>
                <!--//결과내용-->
                <p><img src="http://www.unsin.co.kr/images/sub/money/table1_bottom.png" /></p>
               </div>
</div>
</body>
</html>